package com.wzh.oj.judge.codesandbox;

import com.wzh.oj.judge.codesandbox.impl.ExampleSandCode;
import com.wzh.oj.judge.codesandbox.impl.RemoteCodeSandbox;
import com.wzh.oj.judge.codesandbox.impl.ThirdPartyCodeSandbox;

import static com.wzh.oj.model.enums.CodeSandEnum.*;

/**
 * @author 沙箱静态工厂
 */
public class CodeSandboxFactory {

    public static CodeSandbox getCodeSandbox(String type){
        switch (type){
            case "example":
                return new ExampleSandCode();
            case "remote":
                return new RemoteCodeSandbox();
            case "thirdParty":
                return new ThirdPartyCodeSandbox();
            default:
                throw new IllegalStateException("Unexpected value: " + type);
        }
    }
}
